// @/api/interface/space.ts
export namespace Space {
  export interface Group {
    FId: number;
    FName: string;
    FIsdefault: number;
    FCreatedAt?: string;
  }
  export type GroupList = Group[];

  export interface SpaceItem {
    FId: string;
    FTitle: string;
    FDescription: string;
    FGroupId: number;
    FCreatorId?: string;
    FCreatorName?: string;
    FCover?: string;
    FTag?: string;
    FIsStarred?: boolean;
    FCreatedAt?: string;
    FUpdatedAt?: string;
  }
  export type SpaceList = SpaceItem[];

  export interface SpaceDetail extends SpaceItem {
    FGroupName: string;
  }

  export interface CreateSpaceParams {
    FTitle: string;
    FDescription: string;
    FGroupId: number;
    FTag?: string;
    FCover?: string;
    FCreatorId: string;
  }
  export interface UpdateSpaceParams {
    FId: string;
    FTitle: string;
    FDescription: string;
    FGroupId: number;
    FTag?: string;
    FCover?: string;
    FModifierId: string;
  }

  export interface DeleteSpaceParams {
    FId: string;
  }

  export interface ToggleFavoriteParams {
    FSpaceId: string;
    FUserId: string;
    FIsStarred: boolean;
  }

  export interface GroupUpdateParams {
    FId: number;
    FName: string;
    FIsdefault: number;
  }
  export interface GroupAddParams {
    FName: string;
    FIsdefault: number;
  }
  // 新增空间管理员相关类型
  export interface SpaceAdmin {
    FUserId: string;
    FUsername: string;
    FEmail?: string;
    FCreatedAt: string;
  }
  export type SpaceAdminList = SpaceAdmin[];

  export interface AddSpaceAdminParams {
    FSpaceId: string;
    FUserId: string;
  }

  export interface RemoveSpaceAdminParams {
    FSpaceId: string;
    FUserId: string;
  }

  export interface GetSpaceAdminsParams {
    FSpaceId: string;
  }

  export interface CheckAdminParams {
    FSpaceId: string;
  }

  export interface CheckAdminResult {
    isAdmin: boolean;
  }
}
